package com.example.webflux;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Mono;



@RestController
public class WebFluxController {
    /**
     *  注解控制器的形式，返回值必须是 Flux<Bean> / Mono<Bean> 不能用 Flux<ServerResponse> / Mono<ServerResponse>
     */
    @GetMapping("/webfluxano")
    public Mono<User> getWebFluxResponse(){
        return Mono.just(User.builder()
                .age(1)
                .name("evan")
                .build());
    }

}
